<template>
	<view class="">
		<!-- title="退款记录详情" -->
		<u-navbar title="换货记录详情" :background="background" :border-bottom="flag" title-color="#ffffff"
			back-icon-color="#ffffff"></u-navbar>
		
		<view class="bj" v-if="obj.status==0">
			<view class="stepbox">
				<u-steps :list="numLista" current="1" un-active-color="#cbbfbf"  mode="number" active-color="#ff9900">
				</u-steps>
			</view>
		</view>
		<view class="bj" v-else>
			<view class="stepbox">
				<u-steps :list="obj.type==1?numList:numLists" :current="current" un-active-color="#cbbfbf"  mode="number" active-color="#ff9900">
				</u-steps>
			</view>
		</view>
		<view class="contant">
			<view class="title">
				审核留言
			</view>
			<view class="hr"></view>
			<view class="nr">
				{{obj.leaving_message?obj.leaving_message:"暂无审核留言"}}
			</view>
		</view>

		<view class="contants">
			<Modkexq :arr="obj.commodity"></Modkexq>
		</view>
		<view class="contantss">
			<view class="title">
				申请记录
			</view>
			<view class="boxs">
				<text>售后类型</text>
				<text v-if="obj.type==1" class="tuhuo">换货</text>
				<text v-if="obj.type==2" class="tuhuo">退款（￥{{obj.money}}）</text>
			</view>
			<view class="boxs">
				<text>申请时间</text>{{obj.create_time}}
			</view>
			<view class="boxs">
				<text>退款原因</text>{{obj.reason}}
			</view>
			<view class="boxs">
				<text>问题描述</text>{{obj.describe}}
			</view>
			<view class="boxs">
				<text>凭&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp证</text>
				<view class="imgbox" v-for="(v,i) in obj.imgs" :key="i">
					<image :src="v"  mode="" @click="preview(obj.imgs)"></image>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import Modkexq from "../../components/Modkexq/index.vue"
	import {getsalespeed} from "../../api/api/index.js"
	export default {
		data() {
			return {
				background: {
					backgroundColor: "#F42121"
				},
				flag: false,
				numList: [{
					name: '平台审核'
				}, {
					name: '卖家收货'
				}, {
					name: '卖家发货'
				}, {
					name: '处理完成'
				}],
				numLists: [{
					name: '平台审核'
				}, {
					name: '卖家收货'
				}, {
					name: '进行退款'
				}, {
					name: '处理完成'
				}],
				numLista:[{
					name: '平台审核'
				}, {
					name: '申请失败'
				}, {
					name: '进行退款'
				}, {
					name: '处理完成'
				}],
				// 订单结算id
				id:0,
				obj:{},
				current:0
			}
		},
		components: {
			Modkexq
		},
		methods: {
			// 预览图片
			preview(v) {
				uni.previewImage({
					urls: v,
					longPressActions: {
						itemList: ['发送给朋友', '保存图片', '收藏'],
						success: function(data) {
							console.log('选中了第' + (data.tapIndex + 1) + '个按钮,第' + (data.index + 1) + '张图片');
						},
						fail: function(err) {
							console.log(err.errMsg);
						}
					}
				})
			}
		},
		onLoad(v) {
			this.id=v.id
		},
		onShow() {
			getsalespeed({id:this.id}).then(res=>{
				this.obj=res.data
				if(res.data.status==2){
					this.current=0
				}
				if(res.data.status==3){
					this.current=1
				}
				if(res.data.status==4){
					this.current=3
				}
				if(res.data.status==5){
					this.current=4
				}
			})
		}
	}
</script>

<style scoped lang="scss">
	.bj {
		background-color: #f42121;
		width: 100%;
		height: 225rpx;
		padding-top: 49rpx;
		box-sizing: border-box;

		.stepbox {
			// background: url(../../static/image/hhbj.png) no-repeat;
			background: url("http://youjialibo.wm76.mtnet.ren/upload/20210915/0450b601eec38d9452436e4e6db2a1de.png") no-repeat;
			background-size: 700rpx 177rpx;
			width: 700rpx;
			height: 177rpx;
			margin-left: 25rpx;
			padding: 46rpx 46rpx 32rpx 44rpx;
			box-sizing: border-box;
		}
	}

	.contant {
		width: 700rpx;
		background-color: #FFFFFF;
		border-radius: 6rpx;
		margin-left: 25rpx;
		padding: 45rpx 30rpx 30rpx 30rpx;
		box-sizing: border-box;

		.title {
			font-family: MicrosoftYaHei-Bold;
			font-size: 24rpx;
			color: #000000;
			font-weight: 700;
		}

		.hr {
			width: 664rpx;
			height: 1rpx;
			background-color: #e0e0e0;
			margin-top: 10rpx;
			margin-bottom: 15rpx;
		}

		.nr {
			font-family: MicrosoftYaHei;
			font-size: 20rpx;
			line-height: 40rpx;
			color: #282828;
		}
	}

	.contants {
		width: 700rpx;
		border-radius: 6rpx;
		margin-top: 20rpx;
		margin-left: 25rpx;
	}

	.contantss {
		width: 700rpx;
		margin-left: 25rpx;
		background-color: #FFFFFF;
		border-radius: 6rpx;
		margin-top: 20rpx;
		padding: 24rpx 18rpx 56rpx 30rpx;
		box-sizing: border-box;

		.title {
			font-family: MicrosoftYaHei-Bold;
			font-size: 24rpx;
			color: #000000;
			font-weight: 700;
		}

		.boxs {
			font-family: MicrosoftYaHei;
			font-size: 24rpx;
			color: #000000;
			margin-top: 40rpx;
			display: flex;

			text {
				width: 96rpx;
				font-family: MicrosoftYaHei;
				font-size: 24rpx;
				color: #666666;
				text-align: justify;
				display: inline-block;
				margin-right: 30rpx;
			}
			.tuhuo{
				width: 200rpx;
				font-family: MicrosoftYaHei;
				font-size: 24rpx;
				color: #000000;
			}

			.imgbox {
				width: 160rpx;
				height: 160rpx;
				border: 1rpx dashed;
				margin-right: 15rpx;

				image {
					width: 100%;
					height: 100%;
				}
			}
		}
	}
</style>
